//存储模块
const key = 'USER_INFO'

//存储用户信息
export function setUserInfoStorage(userInfo: object) {
    localStorage.setItem(key, JSON.stringify(userInfo))
}

//获取用户信息
export function getUserInfoStorage() {
    const userInfo = localStorage.getItem(key)
    return userInfo ? JSON.parse(userInfo) : {}
}

//删除用户信息
export function removeUserInfoStorage() {
    localStorage.removeItem(key)
}